<?php
include '../models/GetArtWork.php';
$artmodel = new GetArtWork();
$list = $artmodel->getArt();
$jsonResponse = array("art" => array());
for($i = 0; $i < count($list); $i++) {
	$artpiece = $list[$i];
	$piece = array ( 'id'=>$artpiece->getID(), 'title'=>$artpiece->getTitle(), 'medium'=>$artpiece->getMedium(),
					 'dimension'=>$artpiece->getDim(), 'description'=>$artpiece->getDesc(), 'url'=>$artpiece->getURL(),'thumbnail'=>$artpiece->getThumb());
	array_push($jsonResponse["art"],$piece);
}

echo json_encode($jsonResponse);
?>